package com.success.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * Created by IntelliJ IDEA.
 *
 * @author MagicMushroom
 * @date 2021/6/26
 */
@Aspect
@Component
public class MyAspect {

    @Pointcut("execution(* com.success.service.*.login(..))")
    public void pc1(){};

    @Around("pc1()")
    public Object around(ProceedingJoinPoint joinPoint){
        System.out.println("__________________________log____________________________________");
        Object ret=null;
        try {
            ret = joinPoint.proceed();
        }catch (Throwable ignored){
            ignored.printStackTrace();
        }
        System.out.println("__________________________log____________________________________");
        return ret;
    }
}
